Contents

About this extension

Homepage: http://www.mutschler.de/mp3ext

MP3Ext is an extension for the explorer. It adds a new page to the properties-menu of MP3-files. It shows all info about the mp3-file, e.g. the playlength, bitrate, sample-frequency, and the ID3-Tag if the file has got one. You can even edit the ID3-Tag, and scan complete directories.

It installs an Icon-handler dor displaying different icons for different bitrates

A tooltip-handler is installed, which displays tooltips for MP3s where the system supports tooltips

Warranty

MP3ext is distributed under the GNU Plublic License, which is included in the original distribution of mp3ext.

Further, you use mp3ext at your own risk. I am not responsible for any damages done by mp3ext.

ID3-Tag

MP3ext can handle ID3v1.0, ID3v1.1, ID3v2.2, ID3v2.3 tags. It cannot handle ID3v2.4 tags. when writing the tag, an ID3v1.1 and ID3v2.3 tag is written.

ID3V2-notes:
  1. only a few tags are yet implemented.
  2. unsynchronization not supported
  3. The short form of the TCON-Frame is not supported, neither is the writing of the char "("
  4. The follwowing frames are fully implemented: TIT2, TIT3, TPE1, TPE2, TPE3, TCOM, (TCON), TALB, TRCK, TYER, APIC, TSIZ, USLT The rest is just taken as is. So no unknown frame will be deleted.

New Themes: just create a file in the Themes directory woth the extension .mp3theme. The format of a theme-file is quite easy, just look at the norman.mp3theme as an example.

The property page

Multiple files

Since V2.1 multiple files are supported. Therefore there are some things, which need to be explained: You are given the total time, and the average time of all MP3 files. The number of read files is given too (including the number of files which actually have an ID3-Tag). If the MP3-files have different properties, i.e. you have selected a file with a bitrate of 128000 and 56000 the bitrate field displays "128k, 56k". The same applies to the other fields too (Mode, Layer, Freq, Version). Since this multi-info-feature uses much space, I am using abbreviations, such as 128k for 128000 or 44k1 instead of 44100. The mode field has the following abbreviations:
JS=Joint-Stereo, S=Stereo, DC=Dual-Channel, SC=Single-Channel

Editing multiple files:
The first file, which is being scanned is displayed. In fact it's the file which is the selected one (the one you right-clicked on). You can click through the files by using the '>' and '<' buttons. On the left side of the edit-fields you have a check-mark. If this is checked, the associated field will be copied to the next MP3 you are going to edit. This way you can set defaults for the rest of the files. The next feature is the drop-down list, which contains the strings of all scanned files which have a valid string in this field.

Searching

If you select a bunch of MP3s (e.g. recursive on a whole Harddisk), and you want to know where a special file is, you can search in the list MP3ext curently has got: simply hold down the shift-key while selecting something in the drop-down list of the fields. The next file with this field will get the current one.

Other functions

Default values

It is now possible to set default values for the various (string) frames, after a scan is performed. Therefore, if the fields to set are not empty they will get a default value. There is no GUI for this feature, and you have to configure this in the registry on your own: Start Regedit and browse to the key
HKEY_CURRENT_USER\Software\MM\MP3ext\Templates
Then add a Stringvalue named "DefaultFrames". It consists of a comma seperated list of the 4-char ID3v2 Tag identifiers, which you want to set values for. e.g. to set the comment and the encoder you would add set the value to "COMM,TENC". The order is irrelevant. The next step is to set the value. Therefore add a value for each Tag with the name "default<TAGNAME>", and its content is the actual string that will be set. e.g. "defaultCOMM" with a content of "default Comment from the registry". Do the same for the TENC-tag. Now your finished with the configuration. Now the Encoder and Comment fields will be set after the filename has been scanned.

Image-support.

Now you can finally add your favourite pictures to MP3s. You can add a picture for a specific type, when you click on the checkmark. Then you will get a requesterm where you can select a file to load.

Note: MP3ext does *not* perform any checks of the validity of the file you load. The mime-type is taken from the extension of the file. You can, e.g. load a text-file, e.g. pic.txt, which would be loaded, and set to a mime-type of "image/txt"...

Clicking again on the checkmark, will remove the picture from the tag. The action-buttons (view, save) work on the image seleted with the radio buttons.

A note to the view-button. Since I don't want to compile support for all the different picture-types, The following procedure is done: The file ist saved Temporarily to a file with the endling of the mime-type. e.g. if the mime-type is "image/jpeg" then the created file is mp3extpicture.jpeg. Then ShellExecute("open") is called on the created file, thus calling your installed viewer for this filetype.

TSIZ-support

When a new ID3v2-Tag is saved, then there is always a TSIZ-frame saved. This frames stores the length of the MP3-file without the ID3v2 header. If this frame exists, then the stored one will be used. It is never changed! Now, what is it for? Some people asked me to add a feature to recognize incomplete MP3 files. So here you are. In the new Size-field of the MP3-page, you see when the TSIZ-info doesn't match the actual size. a negative number means, there is data missing; a positive value means, there is too much data. Although the latter case shouldn't happen.

To use this in the Tooltips, I created a new action-element called $(diffwarn). This tag creates a warning text, if the diffsize is 0. Additionally there is the new keyword $(diffsize), which is the difference as shown in the Size-field.

Note: If you see a Size-Tag in the framelisting, (e.g. the tooltips), then the size displayed there is not the actual size of the file, but the size of the MP3-data!

the icon handler

The Icon will be stored inside the MP3-file, as a "APIC"-frame, Type 0x02, and mime-type "image/ico".
if the handler doesn't find an icon in the file, some internal icons are shown:

  1. if the bitrate of the MP3 is <96k then a red MP3-icon is displayed
  2. if the bitrate of the MP3 is 96k/112k/128k, a corresponding icon is displayed
  3. if the bitrate of the MP3 is >128k then a blue MP3-icon is displayed

submitting new Icon-themes:
If you made a new Icon-theme and you want me me to put it on my page be sure you have the following included:

  1. the .mp3theme file
  2. the icons itself
  3. for every different theme included:

If you send me themes with some of the files missing, I will not add them to my page!

Using the Actions

The actions are used for exporting the MP3-data you can see into a file or a clipboard. If you specify a file, the file will be executed, after it has been generated, just like a double-click on the explorer. Therefore you can even treat them as a kind of macro. You can for example make your own renaming of the MP3s by creating a batch-file, or create a html-file which will be shown immediately, or simply copy an album to the clipboard. The clipboard has the advantage of being able to use the data directly in another program such as a word-processor of graphic program. It helps a lot when you create covers for CDs...

How are they used?

The action-button changes ist name each time you select a different action. If you left-click on the button the last action will be executed on the current file. If you hold down the shift-key, all files will be used.
When pressing the right button over the action-button, you get a list of all available actions, and the selected one will be executed. The trick with the shift-key works here too, which executes the action on all loaded MP3 files

How do I manage them?

The first thing about them is, they are pure ascii-files, which can be edited with any text-editor, such as notepad. They are stored in a directory which can be set on the config page. The directory is scanned when you get the action-menu the first time (and after clicking OK, on the config-page). On the config page you can load and save them. When you click on the load button you automatically get a requester pointing to the current ActionPath. The same is done for the saving too. When clicking OK, the current edited is not set automatically; you have to select a new one with the right button.

The Actions of MP3ext have the extension ".mp3a"

Editing the actions

An action consists of four entries:

  1. ActionFilename: This is the filename you wish to write to. You can use environment-variables too like %TEMP%; they will be expanded automatically. After the environment-variables are expanded, the keywords are replaced. So you can e.g. use the album-name as a part of the filename. A special meaning has got the filename called "Clipboard". If you use this, no file is generated, but the data is copied into the clipboard. Be sure that the resulting size does not exceed 64kb! This is a limit of Windows! Future versions of windows might not have this limit.
  2. ActionHeaderFormat: Here you specify the format of the header. The header will be written once before the files are written. If you use MP3-specific data here, then the data of the first MP3 will be used.
  3. ActionFileFormat: Here you specify the format of the files. This is writtenfor all the files.
  4. ActionFooterFormat: Here you specify the format of the footer. The footer will be written once after the files are written. If you use MP3-specific data here, then the data of the first MP3 will be used.

The syntax is the same for all three entries. Keywords are entered as "$(keyword)" and if you want a "$" you have to enter "$$". In addition I added some special characters too for more flexibility:

Some information, you can use is specific to an MP3. In order to have some useful values in the header and footer, this info is taken from the first selected MP3. This way you can for example make a list for a complete album if you use the following template, when you select all the files from the album:
ClipHeaderFormat: "Artist: "$(artist)" Album: "$(album)" Total Time: $(tottime)"
ClipFileFormat: "$(number): $(time) - $(title)"
ClipFooterFormat: ""
When the Filenames are sorted in the order of the tracks, and you right-clicked on the first one, you get a quite useful listing of a complete album. e.g. the files: love1.mp3, love2.mp3, love3.mp3, love4.mp3, love5.mp3 would result in:

Artist: "Dire Straits" Album: "Love over gold" Total Time: 40:54
1: 14:13 - Telegraph road
2: 06:43 - Private investigations
3: 05:48 - Industrial disease
4: 06:15 - Love over gold
5: 07:55 - It never rains
Now the list of keywords: (some entries can be retrieved in two types: abbreviated and normal. The abbreviated version returns a short version of the info. i.e. 128k instead of 128000.)
keyworddescription
albumalbum from ID3
artistartist from ID3
avgtimeaverage time
bitratebitrate
brbitrate abbrev
commentcomment from ID3
count# files
curdatecurrent date with the format mm/dd/yy
curtimecurrent time with the format hh:mm:ss
filefile with path (the same as $(path)\$(filename) )
filenamefilename without path
filesizesize of the file in bytes
filesizeksize of the file in kilobytes
filesizeMsize of the file in megabytes
genregenre-string from ID3
layerlayer-string
modmode abbrev
modemode
mpegverMPEG version
numbercurrent number of the file
pathpath without filename
samplefrequencysample frequency
secavgtimeaverage time in seconds
sectimelength in seconds
sectottimetotal length in seconds
sfreqsample frequency abbrev
timelength of mp3
titletitle from ID3
tottimetotal time
tracktrack number from ID3
track2track number from ID3 formatted with 2 digits, and leading zero if necessary
volumeName of the Partition, the MP3 is located; Volume-name of the disk
yearyear from ID3

Fileformat of the actions

For those, who want to create the files on their own, can do so with any text-editor, such as notepad. The files is constructed as follows:

[ActionFilename]
<file>
[ActionHeaderFormat]
<format>
[ActionFileFormat]
<format>
[ActionFooterFormat]
<format>

The Keywords must start at the beginning on a line; and the format can be several lines. The beginning of the file can contain anything; I start reading when I have found the first keyword.

The file analyzer

Go to the config-page and select the Templates-Tab. There you can configure the filename-analyzer. Now you can specify your own templates based on regular expressions. The analyzer tries all the templates on the filename (incl. path), and if it matches, it applies the substrings to the according fields in the ID3-Tag, if they are empty. If more than one template matches, then this procedure is done more than once. So put the more complex templates at the top, and the general templates at the bottom of the list.

The template:
They are simple regular expressions. If you want to match a specific field, e.g. the track, then you must put the 4-char id3v2-identifier followed by a ':' in the first part of a subexpression: (TRCK:[0-9]*). This would be converted to the subexpression ([0-9]*), and if it matches, the part that matched will be written to the track. For more information about Regular expressions see the documentation to the rx.lib I am using, or in more detail check out various documenation on UNIX-regex, or PERL-documentation.

Note:
In order to be platform-independent with the filename, all backslashes are converted to normal slashes.
i.e. c:\temp\xx.mp3 -> c:/temp/xx.mp3

The following fields are currently recognized:

Now some examples:

  1. Match the filename as the title.
    The title is TIT2. Since we need a subexpression, lets start with a simple "(TIT2:.*)". This wint work, since we must match the complete filename and path. So extend it to .*/(TIT2:.*)\.mp3.
  2. match the following: "path\artist-title.mp3"
    Let us continue on the previous expression, and extend it with the artist: .*/(TPE1:.*)-(TIT2:.*)\.mp3
  3. try and match the track:
    A track consists of only numbers, so match any number of numbers: .*(TRCK:[0-9]*).*mp3
  4. Since a track is handled as a string this would result in numbers of "01". And to better match the track, limit the length to 2 numbers. First do the second problem: .*(TRCK:[0-9][0-9]).*mp3
    In order to remove the leading zero, you have to do 2 templates. the first one takes care of the zero, and the second matches the other 2-digit numbers:
    1. .*0(TRCK:[0-9]).*mp3
    2. .*(TRCK:[1-9][0-9]).*mp3
    You can put these two in one regex:
    .*(0(TRCK:[0-9])|(TRCK:[1-9][0-9])).*mp3
    and if you want to match single numbers too, just make the leading zero of template 1 optional:
    .*(0?(TRCK:[0-9])|(TRCK:[1-9][0-9])).*mp3

Support

Since I am quite busy, and I now stop development of mp3ext, there will be no big support in the future. The only exception is if you find a serious bug (like memory leak). In this case, send an email to michael@mutschler.de, including the OS you are using, and the MP3ext Version installed. Otherwise I will simply ignore the mail (or reply with RTFM, which means the answer is in this document).